Setting up a cron job generator
Build a properly formatted crontab line for scheduling any recurring task on your server, with a live preview showing exactly when it'll next run.Common cron mistakes
- Setting both a day of the month and a day of the week expecting them to combine ("only the 1st, and only if it's a Monday"). Cron treats them as OR - 1st of month AND Monday actually runs 1st of month OR every Monday, whichever comes first.
- Leaving a field blank thinking it means "never run this". A blank/unselected field means every value for that field - to genuinely skip a schedule, disable or remove the cron entry itself.
- Using a relative script path like ./backup.sh instead of /home/youruser/backup.sh. Cron jobs run with a minimal environment and no working directory assumptions - relative paths (and relying on PATH for interpreters like
phporpython) are a common source of "it works when I run it myself but not on cron" reports. - Selecting both 0 and 7 for day of week thinking they're different days - both mean Sunday. Pick one, not both.
Every hour of the day
Every day of the month
Every month of the year
Every day of the week
About cron jobs
A cron job is a task that runs automatically on a schedule you set, without you needing to trigger it by hand - the "cron" daemon is a scheduling service built into virtually every Linux and Unix-based server (and by extension, most web hosting). A crontab ("cron table") is simply the file listing which commands to run and when, using the five-field time format this generator builds for you. It's the Linux equivalent of Windows Task Scheduler, just controlled through a plain text file instead of a GUI.
Common uses include automated backups of a website or database, rotating or clearing old log files, warming a cache on a schedule, sending a recurring report by email, running scheduled cleanup or maintenance scripts, and periodic health checks that alert you if a service goes down.
A couple of usage notes for the form above: holding Ctrl (Cmd on a Mac) while clicking lets you select multiple values in one list. Leaving a list at its default ("every ...") is the same as not restricting that field at all - see the mistakes above for why that matters more than it sounds.
Frequently asked questions
What do the 5 fields in a crontab line actually mean?
In order: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, where both 0 and 7 mean Sunday). An asterisk (*) means "every value" for that field. This generator builds all five for you from the options above.
Why do the "next run" times use my computer's clock?
The preview runs entirely in your browser, so it calculates using your computer's local date, time and timezone. Your actual server may run in a different timezone - always double check the server's own time (run the "date" command over SSH) before relying on exact timing.
What's the difference between choosing a day of the month and a day of the week?
If you set both (e.g. "on the 1st" AND "every Monday"), cron treats them as OR, not AND - the job runs on the 1st of the month, and separately on every Monday, not only on Mondays that happen to be the 1st. Leave one as "every" if you only want to filter by the other.
My cron job isn't running - what should I check first?
Confirm the command's full path is correct (paths that work when you're logged in via SSH aren't always on cron's PATH), check that the script is executable (chmod +x), and look at your crontab's log output or mail (MAILTO) for error messages - most "silent failures" are a missing interpreter path or a permissions issue.
